﻿using System.Windows.Forms;

namespace PhotoFramePublishingPlugin
{
    internal class FolderBrowserDialogFactory : IFolderBrowserFactory
    {
        public string SelectedPath { get; set; }
        public string Description { get; set; }

        public bool ShowDialog()
        {
            var folderBrowserDialog = new FolderBrowserDialog { SelectedPath = SelectedPath, Description = Description };
            DialogResult result = folderBrowserDialog.ShowDialog();
            if (result == DialogResult.OK)
            {
                SelectedPath = folderBrowserDialog.SelectedPath;
                return true;
            }

            return false;
        }
    }
}